package com.jiangxjsy.crm.controller;

import com.jiangxjsy.core.wrap.Result;
import com.jiangxjsy.core.wrap.ResultBuilder;
import com.jiangxjsy.crm.service.CrmFieldService;
import com.jiangxjsy.model.crm.vo.CrmFieldSortVO;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * wukong-crm-master
 * 蒋胜宇
 * 2025/6/18 16:14
 */

@RestController
@RequestMapping("/crmField")
public class CrmFieldController {
    @Resource
    private CrmFieldService crmFieldService;

    /**
     * 查询模块字段列表
     *
     * @param label 标签
     * @param request 请求
     * @param response 响应
     * @return 模块字段列表
     */
    @PostMapping(value = "/queryListHead/{label}")
    public Result<List<CrmFieldSortVO>> queryListHead(@NotNull @PathVariable("label") Integer label, HttpServletRequest request, HttpServletResponse response) {
        List<CrmFieldSortVO> voList = crmFieldService.queryListHead(label, request, response);
        return ResultBuilder.ok(voList);
    }
}
